# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=angr
pkgver=9.2.182
pkgrel=9
epoch=1
groups=('blackarch' 'blackarch-binary' 'blackarch-disassembler'
        'blackarch-reversing')
pkgdesc='The next-generation binary analysis platform from UC Santa Barbaras Seclab.'
arch=('x86_64' 'aarch64')
url='https://pypi.org/project/angr/#files'
license=('BSD-2-Clause')
depends=('python' 'python-capstone' 'python-networkx' 'python-rpyc'
         'python-progressbar' 'python-mulpyplexer' 'python-unicorn'
         'python-cooldict' 'python-archinfo' 'python-pyvex' 'python-ana'
         'python-claripy' 'python-simuvex' 'python-cle' 'libffi'
         'python-cachetools' 'python-pyelftools' 'python-cffi' 'python-psutil'
         'python-bintrees' 'python-dpkt' 'python-z3-solver' 'python-gitpython'
         'python-sortedcontainers' 'python-pycparser' 'python-ailment'
         'python-protobuf' 'python-itanium-demangler' 'python-cppheaderparser'
         'python-sympy' 'python-nampa' 'python-unique-log-filter' 'python-rich'
         'python-msgspec' 'python-cxxheaderparser' 'python-pydemumble')
makedepends=('python-build' 'python-setuptools-rust' 'rust' 'python-pip')
source=("https://files.pythonhosted.org/packages/source/${pkgname::1}/$pkgname/$pkgname-$pkgver.tar.gz")
sha512sums=('f86a28e3066860f4bbf4c33d42ff35abe66d7a1d6cb7b744282594a2f44afd2d5839e3162bff23f83a8e47065102a31138db260857f4eb4c783b2b8c888084d7')

prepare() {
  cd "$pkgname-$pkgver"

  sed -i 's|unicorn==1.0.2rc4|unicorn|g' setup.py
}

build() {
  cd "$pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $pkgname
}

